# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=libiphb
pkgver=1.2.7
pkgrel=2
_commit_dbus_glib="d42176ae4763e5288ef37ea314fe58387faf2005"
pkgdesc="Nemo's libiphb"
url="https://github.com/sailfishos/libiphb"
arch="all"
license="LGPL-2.1-or-later"
depends_dev="
	dbus-dev
	dbus-glib-dev
	glib-dev
	libdsme-dev
	mce-dev
	"
makedepends="$depends_dev
	autoconf
	automake
	libtool
	"
subpackages="$pkgname-dev"
source="https://github.com/sailfishos/libiphb/archive/$pkgver/libiphb-$pkgver.tar.gz
	https://github.com/sailfishos-mirror/dbus-glib/archive/$_commit_dbus_glib/dbus-glib-$_commit_dbus_glib.tar.gz
	"
options="!check" # No suitable tests

prepare() {
	default_prepare

	rmdir dbus-gmain
	mv "$srcdir/dbus-glib-$_commit_dbus_glib" dbus-gmain
}

build() {
	./verify_version.sh
	./autogen.sh
	./configure \
		--prefix=/usr \
		--disable-static
	make
}

package() {
	DESTDIR="$pkgdir" make install

	# Remove tests
	rm -rf "$pkgdir"/opt
}

sha512sums="
734dbfb5ac87e1ba5ffcfa2e4d779591b05343343648706131e222920321761e0da0d8a0695691e79e49a1ab7eb71ab084cdb02fbe7c57227040132cf8423b2b  libiphb-1.2.7.tar.gz
665cd6395ee0ea14086ba30188c62a72697b3f63484681e18fc7f54109c9aca162f2e33aa2fa4d45287c6c0b590e81ca310c143dac0232cd5887692cdaf51256  dbus-glib-d42176ae4763e5288ef37ea314fe58387faf2005.tar.gz
"
